<template>
	<text class="nums-f">{{filterNumber(val)}}</text>
</template>

<script>
	export default {
		props: {
			val: {}
		},
		name: "c-number",
		filters: {
			
		},
		data() {
			return {

			};
		},
		methods:{
			filterNumber(val) {
				let number = ~~val
				if (number >= 1000000) {
					const integerPart = Math.floor(number / 1000000);
					const decimalPart = Math.floor((number % 1000000) / 100000);
					return integerPart + "." + decimalPart + "m";
				} else if (number >= 1000) {
					const integerPart = Math.floor(number / 1000);
					const decimalPart = Math.floor((number % 1000) / 100);
					return integerPart + "." + decimalPart + "k";
				} else {
					return number.toString();
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
.nums-f{
	color: #fff !important;
}
</style>